dojo.declare("MVendorOrderCurrentPg", wm.Page, {
    start: function() {

        this.reloadMyOrders();
    },
    "preferredDevice": "phone",

    reloadMyOrders: function() {
        var mainPage = wm.Page.getPage("MobileMainPg");

        this.lvMyOrders.filter.setValue("customerByVendorId.customerId", mainPage.vUserId);

        this.lvMyOrders.update();
    },
    list1OrderIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var comment = '';
        if (rowObj.comments != null) comment = rowObj.comments;

        var display = "<div class='MobileRowTitle'><b>Order#:</b> " + rowObj.orderId +
        "</div>" + "<div class='MobileRow'>" + wm.List.prototype.dateFormatter({
            "formatLength": "medium",
            "dateType": "date and time"
        }, null, null, null, rowObj.orderDt) + "</div>" +
        "<div class='MobileRow'><b>TotalPrice: </b> </div>" +
"<div class='MobileRow'><b>" +rowObj.totalPrice+ "</b></div>" ;
        return display;
    },
    list1StatusFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var display = "<div class='MobileRowTitle'><b>Status :</b> </br> " + rowObj.status + "</div>";
        return display;
    },
    svUpdateOrderStatusSuccess1: function(inSender, inDeprecated) {
        this.lvMyOrders.clearData();
        this.lvMyOrders.update();
    },
    buttonDeliveredClick: function(inSender) {
        if (this.smOrderStatus.getDataValue()) {
            this.svUpdateOrderStatus.update();
        }
    },
    list1Select2: function(inSender, inItem) {
        this.smOrderStatus.setDataValue("Delivered");
    },
    _end: 0
});